-
Notifications
You must be signed in to change notification settings - Fork 274
Fix a bug with the cache in the BDD to exprt conversion #5005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a bug with the cache in the BDD to exprt conversion #5005
Conversation
91e3dd7
to
be42c64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: be42c64).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122950506
src/solvers/prop/bdd_expr.cpp
Outdated
return a.op0(); | ||
return not_exprt{a}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use boolean_negate
?
Because of how the cache is handled, the expression for one node and its complement will collide in the cache. It is better to get rid of the complement argument and only reason about nodes.
This is more robust as the expression a&!b could equivalently be written !b&a, !(!a|b), !(b|!a)...
This tests a few more cases with BDDs. In particular, the last case would have failed before the bugfix for the BDD cache.
be42c64
to
b8850ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
Passed Diffblue compatibility checks (cbmc commit: b8850ed).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/122966717
There was a bug in which the result for a node and for it's complement would have been stored in the same map entry, this happens with the Cudd library which uses complemented nodes (a node and it's negation are stored at the same address).